package com.linkvin.ec.hcs.vo;

import java.io.Serializable;

/**
 * 业务层返回的数据对象，用以controller加工并提供前端模板渲染
 * Created by qichao on 2017/12/3.
 */
public class RestVO<T> implements Serializable {

    private static final long serialVersionUID = -6820865870078657785L;

    // 返回结果代码
    private int code;

    // 返回数据
    private T data;

    // 返回结果信息
    private String message;

    public RestVO() {

    }

    public RestVO(int code, T data, String message) {
        this.code=code;
        this.data = data;
        this.message = message;
    }


    public RestVO(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "ResultDTO{" +
                "code=" + code +
                ", data=" + data +
                ", message='" + message + '\'' +
                '}';
    }
}
